using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_CustMap : EntityTypeConfiguration<t_Cust>
    {
        public t_CustMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FCustID, t.FItemID, t.FCurrencyID, t.FSELowPrice });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FCustID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FCurrencyID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FSELowPrice)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("t_Cust");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FCustID).HasColumnName("FCustID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FSELowPrice).HasColumnName("FSELowPrice");
        }
    }
}
